import { useStorage } from "../hooks/useStorage";
import useHistory from "../hooks/useHistory";

export default function State () {

  const [count, setCount] = useStorage('count', 0);
  const [url,push,replace] = useHistory();

  return (
    <div>
      <h1>useStorage</h1>
      <div>count: {count}</div>
      <button onClick={() => setCount(count + 1)}>Add</button>
      <button onClick={() => setCount(count - 1)}>Minus</button>

      <div>url: {url}</div>
      <button onClick={() => push('/a')}>push</button>
      <button onClick={() => replace('/b')}>replace</button>
    </div>
  )
}